package com.check.utils;

import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;

import java.io.InputStream;

/**
 * @description:
 * @Author: zyt
 */
public class LoadFxmlUtils {
    public static Parent getParent(String path) throws java.io.IOException {
        Parent root;
        InputStream in = LoadFxmlUtils.class.getClass().getResourceAsStream(path);
        if(in==null){
            InputStream is = LoadFxmlUtils.class.getClass().getResourceAsStream(path);
            root = new FXMLLoader().load(is);
        }else{
            root = new FXMLLoader().load(in);
        }
        return root;
    }
}
